<template>
   <div>

    医生姓名：<el-input v-model="doctorName" placeholder="请输入医生姓名" style="width: 180px;"></el-input> 
      <!-- 日期：   <el-date-picker
      v-model="dateValue"
      type="month"
      placeholder="选择月" value-format="yyyy-MM">
    </el-date-picker> -->
    <el-button type="primary" icon="el-icon-search" style="margin-left: 20px;" @click="query()" >查询</el-button>


    <el-table
      :data="tableData"
      style="width: 100%">
      <el-table-column
        prop="doctorname"
        label="医生姓名">
      </el-table-column>
      <el-table-column
        prop="depname"
        label="科室" >
      </el-table-column>
      <el-table-column
        prop="yearmonthtime"
        label="日期(月)">
      </el-table-column>
      <el-table-column
        prop="morning"
        label="早班次数">
      </el-table-column>
      <el-table-column
        prop="aftering"
        label="午班次数">
      </el-table-column>
      <el-table-column
        prop="evening"
        label="晚班次数">
      </el-table-column>
      <el-table-column
        prop="sumbanci"
        label="总次数">
      </el-table-column>
      <el-table-column
        prop="sumguahaofei"
        label="挂号费">
      </el-table-column>
    </el-table>

    <el-pagination
  background
  layout="prev, pager, next"
  :total="1000">
</el-pagination>
   </div>
</template>
<script>

import { getAll } from '../../api/incomeAndExpenses/Workload'

import { queryDoctor } from '../../api/incomeAndExpenses/Workload'


export default {
   name: '',
   components: {
     
   },
   mixins: [],
   props: {
     
   },
   data() {
     return {

        tableData: [],

        doctorName:'',

        // dateValue:'',

       
     }
   },
   computed: {
     
   },
   watch: {
     
   },
   mounted() {

    this.shwoInfo();

  
   },
   methods: {


    shwoInfo(){

  getAll().then(rep =>{

        this.tableData=rep.data

        console.log(rep.data)

    })
     
    },

    //查询
    query(){

      if(this.doctorName !=''&& this.doctorName !=null ){

        queryDoctor(this.doctorName).then(rep =>{

          this.tableData=rep.data


        })


      }else{

        this.shwoInfo();


      }


   
     

    }
     
   }
};
</script>
<style lang='' scoped>
</style>